public class AjaxTestController {
	Integer BatchSize = 1;
	Integer batch=0;
	List<AJAX__c> GlobalInput_List = new List<AJAX__c> ();
	List<AJAX__c> GI_Update_List = new List<AJAX__c> ();
	Boolean UpdateComplete;
	String msg='';
	public void setUpdateComplete(Boolean setterVal){this.UpdateComplete = setterVal;} 
	public Boolean getUpdateComplete(){return this.UpdateComplete;}
	public PageReference AJAX_Save(){
		Integer startIndex, endIndex;
		startIndex = batch*BatchSize;
		endIndex = (batch*BatchSize)+BatchSize;
		Database.SaveResult[] GI_UpdateResult ;
		
		if(endIndex>=GlobalInput_List.size()){
			endIndex = GlobalInput_List.size();
			UpdateComplete =true;
		}
		GI_Update_List.clear();
		for(Integer i=0; i<GlobalInput_List.size(); i++){
				GI_Update_List.add(GlobalInput_List.get(i));
		}
		//try{
			//update(GI_Update_List);
			GI_UpdateResult = database.update(GI_Update_List,false);
		//}
		//catch(Exception ex){
		//	msg +=  ex.getMessage();
		//	UpdateComplete =true;
		//}
		for(Database.SaveResult giResults: GI_UpdateResult){
			/*if(giResults.getId() != null){
				globalInputUpdatedIds.add(giResults.getId());
			}*/
			for(Database.Error err: giResults.getErrors()){
				msg += err.getMessage()+'<br>';
				UpdateComplete =true;
				System.debug('**********'+err.getMessage());
				//ErrorGenerated =true;
			}
			/*if(giResults.isSuccess()==false){
				UpdateComplete =true;
			}*/
		}
		batch++;
		System.debug('*****************************************'+Limits.getDMLStatements()+'*********'+UpdateComplete);
		return null;
	}
	public void setGlobalInput_List(List<AJAX__c> setterList) {	GlobalInput_List.addAll(setterList);} public List<AJAX__c> getGlobalInput_List(){return this.GlobalInput_List;}
	public AjaxTestController(){
		AJAX__c[] ajax = [Select Rate__c, Exposure__c from AJAX__c];
		GlobalInput_List.addAll(ajax);
		UpdateComplete=false;
	}
}